<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="/product/include/base_product_pre_part.jsp"></jsp:include>
<script type="text/javascript">
<!--
function changeCategory(product_id){
	document.location ="<%=request.getContextPath()%>/category/updateProductCate.do?productId="+product_id;
}

//-->
</script>
<form action="<%=request.getContextPath()%>/product/saveProduct.do" method="post" class="box">
	<table width="100%">
		<s:hidden name="target" />
		<s:hidden name="product.id" />
		<s:hidden name="product.category.id" value="%{category.id}" />
		<tr>
			<td class="tdLabel">
				<s:text name="category" />
			</td>
			<td>
				<s:property value="category.chainName" />
				<input type="button" onclick="javascript:changeCategory('<s:property value="product.id" />');" value="修改" />
			</td>
		</tr>
		<s:textfield name="product.name" label="%{getText('name')}" />
		<s:textarea name="product.introduction" label="%{getText('introduction')}" rows="7" cssStyle="width:400px;" />
		<s:if test="product.id!=null">
			<tr>
				<td class="tdLabel">
					商品/服务参数:
				</td>
				<td>
					<ul id="properties">
						<s:iterator value="product.properties">
							<li>
								<label class="property">
									<s:property value="name" />
								</label>
								&nbsp;&nbsp;&nbsp;&nbsp;
								<span style="background: #f6f6f6;"> <s:iterator value="values">
										<s:property value="value" />&nbsp;&nbsp;
									</s:iterator> </span>
							</li>
						</s:iterator>
						<script type="text/javascript">
						<!--
						$(document).ready(function(){
							var properties = $("#properties").find("li");
							$.each(properties,function(){
								var li = $(this);
								var label = li.find("label").css("cursor", "pointer");
								var span = li.find("span").css("cursor", "pointer");
								label.mouseover(function () {span.show(); });
								span.mouseout(function () {span.hide(); });
							});
						});
						-->
						</script>
					</ul>
					<a href="<%=request.getContextPath()%>/product/editProperties.do?id=<s:property value="product.id" />">管理商品/服务参数</a>
				</td>
			</tr>
		</s:if>
		<tr>
			<td></td>
			<td>
				<input type="submit" class="btn_blue_3" value="提交" />
			</td>
		</tr>
	</table>
</form>
<jsp:include page="/product/include/base_product_last_part.jsp"></jsp:include>